package com.apes.fn.scm.settleCheck.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.util.ApesConst;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 功能：业务分类汇总
 *
 * @author zhuyh
 * @time 14:42
 * @date 2020/3/6
 */
@Deprecated
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = RclBusinessClassification.CONST_TABLE_NAME)
public class RclBusinessClassification extends Model {

    public static final String CONST_TABLE_NAME = "fn_business_classification";

    @Id
    @Column(name = "id", nullable = false, length = 24)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "业务分类汇总单号", padding = 12)
    private String id;

//    @ManyToOne(fetch = FetchType.LAZY)
//    @JoinColumn(name = "serve_type", referencedColumnName = "id")
//    @Comment("业务类型")
//    private ServeType serveType; //

    @Column(name = "servertypeid", length = 250)
    @Comment("业务类型编码")
    private String serverTypeId;


    @Column(name = "servertypename", length = 250)
    @Comment("业务类型名称")
    private String serverTypeName;



    @ManyToOne(optional = false)
    @JoinColumn(name = "partnerAccountStatement_id", referencedColumnName = "id", nullable = false)
    @Comment("赋能对账单号")
    private RclPartnerAccountStatement rclPartnerAccountStatement;


    @Column(name = "money", nullable = false, columnDefinition = ApesConst.FIELD_QTY_16_4_0)
    @Comment("金额")
    private double money = 0.0;//

    @Column(name = "marker", length = 250)
    @Comment("差异说明")
    private String marker;

    @Column(name = "comfirm",columnDefinition = "number(1,0) default 1")
    @Comment("确认")
    private Integer comfirm;


}
